<template>
  <div class="ItemDisplayList">
    <!-- <div class="item" v-for="item in this.$store.state.commonDATA.carsMgsList " :key="item.id"> -->
    <div class="item" v-for="item in carsMgsList" :key="item.id">
      <imgBox :msg="item"></imgBox>
      <!-- <router-link :to="{name:'products',params:{proid:'1'}}">
        <div class="item-img">
          <img :src="item.imgUrl" :alt="item.name" />
        </div>
      </router-link>
      <div class="item-price">
        <span class="ipl">￥479.00</span>
        <span class="f-r ipr">80人付款</span>
      </div>

      <div class="item-introduce">
        <p>
          <router-link :to="{name:'products',params:{proid:'2'}}">{{item.name}}</router-link>
        </p>
      </div>
      <div class="item-place">
        <span class="ipl">{{item.manufacturer}}</span>
        <span class="f-r ipr">{{item.address}}</span>
      </div>
      <div class="item-identifying">
        <span class="el-icon-sell"></span>
        <span class="el-icon-sell"></span>
      </div>-->
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import imgBox from "@/components/imgBox/imgBox";

export default {
  data() {
    return {
      itemList: [{}]
    };
  },
  computed: {
    carsMgsList: function() {
      var data = this.$store.state.commonDATA.carsMgsList;
      var list = [];
      for (var i in data) {
        var obj = {
          c: 1,
          w: "100%",
          h: "100%",
          imgw: "80%"
        };
        obj.src = data[i].imageMain;
        obj.url = { name: "products", params: { proid: data[i].id } };
        obj.t1 = data[i].commodityName;
        obj.t2 = data[i].commodityAttr;
        obj.t3 = data[i].price;
        obj.t4 = data[i].price + 20;
        list.push(obj);
      }
      return list;
    }
  },
  methods: {},
  components: { imgBox }
};
</script>


<style lang="scss" type="text/css" scoped>
@import "../../common/style.scss";
.ItemDisplayList {
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  align-items: 21px;
  .item:hover {
    // border: 1px red solid;
    transition: 0.5s;
  }
  .item {
    font-size: 13px;
    width: 150px;
    height: 220px;
    background-color: white;
    padding: 5px;
    border: 1px #e6e6e670 solid;
    transition: 0.3s;
    margin-bottom: 2px;
    div {
      width: 100%;
    }
  }
}
</style>
